import request from '@/utils/request'


//获取二级分类列表
export async function getList({ page, limit, query, sort }) {
    return await request({
        url: "/typeTwo",
        method: "get",
        params: { page, limit, query, sort }
    });
}

//添加二级分类
export async function addTypeTwo(params) {
    return await request({
        url: "/typeTwo",
        method: "post",
        data: params
    })
}

//修改二级分类
export async function upDate(params) {
    return await request({
        url: `/typeTwo/upDate/${params._id}`,
        method: "put",
        data: params
    })
}

//筛选
export async function search(params) {
    console.log(params);
    return await request({
        url: `/typeTwo/search`,
        method: "post",
        data: params
    })
}


//删除
export async function delType(params) {
    return await request({
        url: `/typeTwo/del/${params._id}`,
        method: "delete"
    })
}